package com.company.practice;

import java.util.ArrayList;
import java.util.List;

/**
 * @description: OOM: gc overhead limit exceeded
 *
 * -Xms10m
 * -Xmx10m
 * -XX:+PrintGCDetails
 * -XX:+UseParNewGC
 * -XX:+PrintCommandLineFlags
 * @author: ruoan
 * @date: 2021/1/5 21:22
 */
public class OOMDemo {

    public static void main(String[] args) {
        List<String> strList = new ArrayList<>();

        int i = 0;
        try {
            while (true) {
                strList.add(String.valueOf(++i).intern());
            }
        } catch (Exception e) {
            e.printStackTrace();
        } finally{
            System.out.println("i的值： "+i);
        }


    }


}
